from db.db import DB

db = DB('advanced')


# 建表
"""
sql1 = 'create table company_news1(id int,title varchar(20),author varchar(20),content varchar(50),' \
       'time varchar(20),count int)charset=utf8 engine=innodb comment=\'公司新闻表\''

print(db.write(sql1))
"""

# 一次性添加5条数据
"""
sql2 = "insert into company_news1 values(1,'NBA','腾讯视频','勇士总冠军','2022-06-17',10000)," \
       "(2,'LOL','拳头','edg世界冠军','2022-04-18',15000),(3,'news1','cctv-1','p_1','2022-05-28',12000)," \
       "(4,'news2','cctv-2','p_2','2022-05-20',999),(5,'news3','cctv-3','p_3','2022-05-22',9999)"

print(db.write(sql2))
"""

sql2 = 'select * from company_news1'
print(db.read(sql2))
